"use strict";

/**
 * 
 * @desc   两个浮点数相除
 * @param  {Number}  num1
 * @param  {Number}  num2
 * @return {Number} 
 */
function accDiv(num1, num2) {
  var t1, t2, r1, r2;

  try {
    t1 = num1.toString().split('.')[1].length;
  } catch (e) {
    t1 = 0;
  }

  try {
    t2 = num2.toString().split(".")[1].length;
  } catch (e) {
    t2 = 0;
  }

  r1 = Number(num1.toString().replace(".", ""));
  r2 = Number(num2.toString().replace(".", ""));
  return r1 / r2 * Math.pow(10, t2 - t1);
}

module.exports = accDiv;